home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / lovr.com / LOVR.DOC < prev    next >
Encoding:
Text File  |  1988-10-30  |  22.3 KB  |  526 lines

  1.                     =======================
  2.                     LOVR 1.12 DOCUMENTATION
  3.                     =======================
  4.  
  5.  
  6.  
  7. LICENSE AND WARRANTY
  8. --------------------
  9.  
  10. LOVR copyright 1988 by Michael E. Devore
  11.  
  12. The copyright holder licenses you to use, copy, and distribute
  13. LOVR for yourself and others subject to the following four
  14. restrictions:
  15.  
  16. 1.  LOVR must be copied and distributed only in its original,
  17.     unmodified form.  This includes the LOVR program object
  18.     module, the LOVR documentation, and all example files.
  19.  
  20. 2.  No fee or other compensation can be charged for copying or
  21.     distributing the program.  The only exceptions are user
  22.     groups and incorporated public domain and shareware software
  23.     distributors who may charge a handling fee for its
  24.     distribution NOT TO EXCEED $7.00 PER COPY.  ONLY ONE COPY
  25.     PER COMPUTER DISK IS ALLOWED FOR SUCH DISTRIBUTION.
  26.  
  27. 3.  LOVR may NOT be distributed in combination with any other
  28.     products, software or hardware, without the express written
  29.     permission of Michael E. Devore.
  30.  
  31. 4.  LOVR is for your personal use only and may NOT be used
  32.     for commercial applications.  See the PLOVR program
  33.     description later in this documentation file if you need to
  34.     use a version of LOVR commercially.
  35.  
  36. There is no warranty of any kind with LOVR and the copyright
  37. holder is not liable for any damages of any kind or nature that
  38. may occur due to use of this software.  By using LOVR you agree
  39. to these terms.  Contrapositively, if you do not agree to these
  40. terms, do not use LOVR.
  41.  
  42. This document copyright 1988, Michael E. Devore.  All rights
  43. reserved.
  44.  
  45.  
  46. ------------------------------------------------------------------------------
  47. ------------------------------------------------------------------------------
  48.  
  49.  
  50. LOVR FILES
  51. ---------
  52.  
  53. Included in LOVR.ARC should be the following files:
  54.  
  55. LOVR.OBJ             (LOVR linkable object module)
  56. LOVR.DOC             (LOVR documentation file, the file you are
  57.                       reading now)
  58. QBNEST.BAS           (QuickBASIC 4.0 example files)
  59. QBNEST.OBJ                       .
  60. BNEST1.BAS                       .
  61. BNEST1.OBJ                       .
  62. BNEST2.BAS
  63. BNEST2.OBJ
  64. BNEST3.BAS
  65. BNEST3.OBJ
  66. BNEST4.BAS
  67. BNEST4.OBJ
  68.  
  69.  
  70. ------------------------------------------------------------------------------
  71. ------------------------------------------------------------------------------
  72.  
  73.  
  74. OVERVIEW
  75. --------
  76.  
  77. LOVR is an overlay manager for QuickBASIC.  In case this is your
  78. first exposure to overlays, the following is a quick overview of
  79. what overlay's are, what an overlay manager is, and why such a
  80. program is useful.
  81.  
  82. Overlays are portions of program code which are loaded from disk
  83. into memory on an as-needed basis.
  84.  
  85. Use of overlays allows an extremely large program (potentially
  86. several megabytes of code in size) to execute in a much smaller
  87. amount of memory.  Code from the program's .EXE file is brought
  88. in from disk (overlaid) only when the program needs it.  Since
  89. all overlays share the same memory space, the memory
  90. requirements can be much less than the total code size of the
  91. program.  Also, there is no longer a need for the clumsy
  92. chaining to another file that large QuickBASIC environments
  93. frequently require.
  94.  
  95. There is a tradeoff for these advantages.  The tradeoff is the
  96. time and code overhead necessary to read overlays in from disk.
  97. If you make the decision to use overlays with your program, any
  98. timing critical code should not be divided between overlays.
  99. For most applications, though, the relatively small amount of
  100. time it takes to read in an overlay from disk is not important
  101. if transfers to overlays are not overdone or poorly timed.
  102. Constant shuttling between overlays is an exercise guaranteed to
  103. give disappointing results.
  104.  
  105. LINK.EXE, Microsoft's Overlay Linker included with MS-DOS and
  106. Microsoft languages, versions 3.x greater than or equal to 3.06,
  107. allows creation of overlaid versions of programs.  However, LINK
  108. only inserts some overlay information and software interrupts in
  109. the program for an overlay manager to use.  LINK doesn't
  110. generate the actual code that loads the proper overlay from disk
  111. and passes control to it.  That's a job for an overlay manager,
  112. and that's where LOVR comes in.
  113.  
  114. LOVR "manages" the overlays.  LOVR loads overlays from disk at
  115. the appropriate time and jumps program execution to the overlay
  116. code.
  117.  
  118. To use LOVR, first compile your QuickBASIC program using the /O
  119. option of BC.EXE.  LOVR will not work with BRUN40.EXE.  Then,
  120. link LOVR.OBJ and your program object modules together using
  121. Microsoft's Overlay Linker.
  122.  
  123.  
  124. ------------------------------------------------------------------------------
  125. ------------------------------------------------------------------------------
  126.  
  127.  
  128. LOVR SPECIFICATIONS AND REQUIREMENTS
  129. ------------------------------------
  130.  
  131. *  LOVR requires an IBM PC or PS/2 microcomputer or close
  132. compatible using MS-DOS or PC-DOS operating system version 2.1
  133. or later.  Microsoft's Overlay Linker, version 3.06 or later,
  134. must be used to link LOVR.OBJ with the object modules of a
  135. program containing overlays.
  136.  
  137. *  LOVR adds approximately 11K bytes to your program's size when
  138. it is linked in.  LOVR will also use a maximum of twelve bytes
  139. of the overlaid program's stack during its operation.
  140.  
  141. *  LOVR has only been tested with QuickBASIC 4.0 programs
  142. compiled using the /O option of BC.EXE and linked using
  143. Microsoft's Overlay Linker.  The object files created by
  144. versions of QuickBASIC earlier than 4.0 abort with an error if a
  145. link is attempted with overlays.  Therefore, LOVR will NOT work
  146. with versions of QuickBASIC earlier than 4.0.  This is a
  147. limitation of the earlier versions of QuickBASIC and not an
  148. error or shortcoming in LOVR.
  149.  
  150. *  Microsoft's Overlay Linker requires the presence of at least
  151. one overlay when linking LOVR.OBJ with a program's object
  152. modules.  An attempt to link LOVR.OBJ with a program without
  153. using at least one overlay will cause LINK to return an
  154. "Unresolved externals" error and abort the link.
  155.  
  156. *  LOVR will handle a maximum of eight overlays.  More than
  157. eight overlays will cause LOVR to abort with a "Too many
  158. overlays." error.  PLOVR, the enhanced version of LOVR, has a
  159. limit of 63 overlays -- LINK's maximum.
  160.  
  161. *  LOVR supports calls from one overlay to another (nesting).
  162. The depth to which overlays can be nested cannot exceed four
  163. levels.  If an attempt is made to nest deeper than four
  164. overlays, LOVR will abort with a "Overlays nested deeper than 4
  165. levels." error.  PLOVR supports a nesting depth of 32 levels.
  166.  
  167. *  LOVR requires use of the Microsoft LINK default overlay
  168. interrupt 63 (3fh).  Do not use the /OVERLAYINTERRUPT or /O
  169. option of LINK to change the overlay manager interrupt.  PLOVR
  170. supports changing the default overlay manager interrupt via the
  171. /O option of LINK.
  172.  
  173. *  LOVR WILL work with the /EXEPACK or /E option of LINK, if the
  174. program containing overlays is suitable for using the /EXEPACK
  175. option.  If the program is not suitable, LINK will abort with a
  176. fatal error.  The documentation for previous versions of LOVR
  177. stating that LOVR and PLOVR would not work with the /EXEPACK
  178. option was in error.
  179.  
  180. *  After your program has been linked with LOVR.OBJ, do NOT
  181. change the program's name.  LOVR attempts to load overlays from
  182. the executable file name assigned during the linking process.
  183. If the file name has been changed, LOVR will abort with a "File
  184. not found" error.  To change the name of your program, you must
  185. relink the program using the new name for your executable file
  186. in the link syntax.
  187.  
  188.  
  189. ------------------------------------------------------------------------------
  190. ------------------------------------------------------------------------------
  191.  
  192.  
  193. USING LOVR
  194. ----------
  195.  
  196. To show how to use LINK to set up overlays a set of sample
  197. QuickBASIC programs demonstrating the use of LOVR's operations
  198. has been included in the LOVR package.  Both source and .OBJ
  199. files have been included.  Although these files perform no
  200. useful function, they do demonstrate both overlay nesting and
  201. parameter passing to another overlay.
  202.  
  203. Link together the LOVR and QuickBASIC .OBJ files, enclosing in
  204. parentheses the modules you want to be overlays.  Make sure that
  205. you use at least one overlay or LINK will return an unresolved
  206. externals error.  If you link the example object files together
  207. like this:
  208.  
  209.      link lovr+qbnest+(bnest1+bnest2+bnest3)+(bnest4),qbnest;
  210.  
  211. a main .EXE file called QBNEST.EXE will be created.  This
  212. QBNEST.EXE file will contain the root .EXE file QBNEST comprised
  213. of the code of the LOVR and QBNEST object modules and will also
  214. contain two overlay files appended to the root .EXE file.  One
  215. overlay file will contain the code of the BNEST1, BNEST2, and
  216. BNEST3 modules, the other will contain the code of the BNEST4
  217. module.
  218.  
  219. The .EXE file created is a standard .EXE file.  Just type QBNEST
  220. at the DOS prompt, and the program will begin to run.  As
  221. program code is needed from an overlay, that overlay is loaded
  222. from disk by the LOVR code if it isn't already loaded, and
  223. program execution continues.  You may be able to see the program
  224. stop running when an overlay is being loaded, depending upon the
  225. speed of your disk and whether or not you are using disk caching
  226. software.
  227.  
  228. The amount of memory required to load the QBNEST.EXE file you
  229. created, or any file created by LINK using overlays, is equal to
  230. the size of the root file (including LOVR.OBJ code) plus the
  231. size of the largest overlay file plus any program overhead.
  232. This brings up an important point.  There is no advantage to
  233. only using one overlay in a program since space must be
  234. allocated for it in memory during program execution anyway.
  235. There is only the disadvantage of the overlay overhead.  In
  236. other words, while the link commands:
  237.  
  238.      link lovr+qbnest+(bnest1)+bnest2+bnest3+bnest4,qbnest;
  239.  
  240.      link /e lovr+qbnest+(bnest1+bnest2+bnest3+bnest4),qbnest;
  241.  
  242.      link lovr+qbnest+bnest1+(bnest2+bnest3)+bnest4,qbnest;
  243.  
  244. are all valid, there is no useful purpose served by linking
  245. overlays in this fashion.  Two or more overlay files in the link
  246. command is the way to go.
  247.  
  248. A more appropriate example of linking using overlays would be:
  249.  
  250.      link /exepack lovr+qbnest+(bnest1)+(bnest2)+(bnest4)+bnest3,
  251.      qbnest;
  252.  
  253. Here there will be three overlay files containing the code of,
  254. respectively, BNEST1, BNEST2, and BNEST4, and a root file
  255. containing the LOVR, QBNEST and BNEST3 code.  Note that the link
  256. syntax includes the LINK /EXEPACK option.  The /EXEPACK or /E
  257. option of Microsoft's Overlay Linker may successfully be used
  258. with LOVR.OBJ for those programs suitable for the option.
  259.  
  260. The only overlay combination not allowed by LOVR is one where
  261. the LOVR or root (in this case QBNEST) object modules are linked
  262. as an overlay.  LOVR and QBNEST contain the start up code which
  263. must be in loaded in memory during the beginning of the
  264. program's execution.
  265.  
  266. To really stretch LOVR to its limits, link each of the BNEST
  267. modules in a separate overlay.  This forces LOVR to nest overlays
  268. to its four level maximum.
  269.  
  270. To use your own QuickBASIC 4.0 programs with overlays you should
  271. compile the files using BC.EXE.  Overlays will not work with the
  272. runtime file BRUN40.EXE so the /O option must be used to compile
  273. QuickBASIC 4.0 programs.
  274.  
  275. Feel free to try any permutation of overlays allowed by these
  276. examples.  LOVR should work with any of them as long as you stay
  277. within the restrictions already outlined.  It is especially
  278. important to remember not to put the initial entry code or
  279. LOVR.OBJ in an overlay.  The start up code must be in memory
  280. when the program is first loaded, i.e. in the root code.
  281.  
  282. You may have noticed that these example files are all small
  283. enough to fit into memory without overlays.  You may even be
  284. asking yourself how you really know that LOVR is bringing the
  285. overlays in as needed instead of sneaking everything in at once?
  286. In fact, how do you know that LOVR is using the overlay manager
  287. interrupt at all?
  288.  
  289. First, you can try running a file linked with overlays without
  290. linking in LOVR.OBJ.  If you do this your computer will probably
  291. lock up and need to be turned off or reset before it can be used
  292. again.  This is because your program is using interrupt 63 which
  293. LOVR hasn't initialized to point to code that manages the
  294. overlays.  Your program tries to transfer control to whatever
  295. random address happens to be at the memory location that
  296. corresponds to the address at interrupt 63, leading to
  297. unpredictable results.  This is also known as a "thin air"
  298. transfer.
  299.  
  300. The second test you can do is transfer your overlaid program
  301. .EXE file to a floppy disk and disable any disk caching.  Now
  302. run LOVR off of the floppy disk drive.  You should see the
  303. floppy disk drive light come on during execution of the example
  304. program as overlays are loaded from disk.  For maximum effect
  305. you may want to link the example program using as many overlays
  306. as possible, up to the maximum of eight.
  307.  
  308. It is important to understand how the use of overlays can affect
  309. a program's performance.  Time critical code should not be
  310. divided between two overlays.  Depending upon the speed of the
  311. disk drive used and the size of the overlay file, the time to
  312. load each overlay from disk can be reach several seconds.
  313. Extremely time critical code should not be divided the root code
  314. and an overlay.  The execution time overhead of the overlay
  315. manager code can range from several microseconds up to a few
  316. milliseconds depending upon the type of machine the overlaid
  317. program is running on.
  318.  
  319. There is NO speed penalty involved in calling routines FROM a
  320. loaded overlay TO the root code or from one code module to
  321. another WITHIN the same overlay file.  There IS a speed penalty
  322. in calling routines FROM the root code TO an overlay file.  This
  323. speed penalty will range from several microseconds with an
  324. already loaded overlay file on a fast computer to several
  325. seconds with an overlay file that needs to be loaded on a
  326. computer with a slow disk drive.
  327.  
  328.  
  329. ------------------------------------------------------------------------------
  330. ------------------------------------------------------------------------------
  331.  
  332.  
  333. PLOVR -- An Enhanced Version of LOVR
  334. ------------------------------------
  335.  
  336. If you wish to sell a program that uses LOVR.OBJ to operate, or
  337. if you just want a more powerful version of LOVR, an enhanced
  338. version of LOVR called PLOVR can be purchased for $45.  PLOVR
  339. works with any overlay interrupt specified by the /O option of
  340. LINK, allows the LINK maximum of 63 overlays, and increases the
  341. depth that overlays can be nested to 32 levels.  The PLOVR
  342. package includes a smaller copy of PLOVR.OBJ called SPLOVR.OBJ,
  343. which takes up 5K of program space in the root code, instead of
  344. 11K.  The trade-off is an occasional increase in time to load an
  345. overlay from disk, but SPLOVR can be useful for those running
  346. close to the memory space limit even with overlays.  PLOVR also
  347. dispenses with the runtime copyright notice.  This removal of
  348. the runtime copyright notice does not suggest, and should not be
  349. taken to suggest, that PLOVR is not copyrighted.  A potentially
  350. distracting message is simply not displayed.
  351.  
  352. No royalties are charged for use of PLOVR.  This means that you
  353. need only purchase a single version of PLOVR for use with your
  354. program no matter how many copies of your program you
  355. distribute.  Purchase of PLOVR entitles the purchaser to
  356. telephone support.  All calls will be at the purchaser's
  357. expense.
  358.  
  359. Note that purchase of PLOVR is MANDATORY if you wish to use a
  360. version of LOVR for distribution with a commercial or shareware
  361. program.  PLOVR is the only version of the overlay manager
  362. permitted for use with such applications.
  363.  
  364. To purchase PLOVR send $45.00, in US dollars, by check or money
  365. order with your shipping address to:
  366.  
  367.     Michael E. Devore
  368.     Devore Software & Consulting
  369.     403 West Charles
  370.     Champaign, IL  61820
  371.  
  372. Please state your preference for either 5 1/4 or 3 1/2 inch
  373. diskettes.
  374.  
  375. All information contained herein, including the cost of PLOVR,
  376. is subject to change without notice.
  377.  
  378. PLOVR copyright 1988 by Michael E. Devore
  379.  
  380.  
  381. ------------------------------------------------------------------------------
  382. ------------------------------------------------------------------------------
  383.  
  384.  
  385. TROUBLE-SHOOTING
  386. ----------------
  387.  
  388. Check to make sure that you have compiled your program properly.
  389. You should compile your source files outside of the QuickBASIC
  390. integrated environment with BC.EXE using the /O option.
  391.  
  392. Use a recent version of Microsoft's Overlay Linker when linking
  393. overlays for LOVR.  LOVR was tested with Microsoft LINK
  394. versions 3.06, 3.60, 3.61 and 3.64.  2.x versions of LINK will
  395. not work.  The copyright notice of LINK must say Microsoft
  396. Overlay Linker,  Turbo C's TLINK or other proprietary linkers
  397. will not work with LOVR.  In addition, if you experience
  398. problems with LOVR, try linking with a different version of
  399. Microsoft's Overlay Linker -- at least one version of the linker
  400. has an error that causes improper overlay operation.
  401.  
  402. Check your link syntax, making sure that neither LOVR nor the
  403. initial entry or main program module is in an overlay, and that
  404. you are not exceeding eight overlay files or nesting overlays
  405. deeper than four levels.
  406.  
  407. If you are sure that you are compiling and linking properly and
  408. operating LOVR within its specifications and requirements, make
  409. sure that the error is not in your program.  If memory size
  410. allows, compile your program without overlays and test it.  If
  411. the size of your program is too large for all of it to fit in
  412. memory, try to compile only the code that is giving you problems
  413. and see if it works correctly without overlays.
  414.  
  415. If your program still fails after you have eliminated all
  416. suspects except for LOVR, please contact me so I can fix the
  417. problem as soon as possible.  In order to facilitate locating
  418. the problem, I will need some background information.  What
  419. error message, if any, does LOVR print?  What version and
  420. options of LINK were used?  What hardware and software
  421. configuration was your machine running under when the error
  422. occurred?  What language was the program written in?
  423.  
  424. If an error is in LOVR and you are the first person to find the
  425. error, I will send you a free corrected version as soon as it is
  426. available.  The corrected version will either be sent by
  427. electronic mail if possible, or regular USPS mail if not.  If
  428. you are not the first person to find the error and do not wish
  429. to wait for the corrected version to reach general distribution
  430. channels, you may send $6.00 to cover shipping and handling for
  431. the latest version to the address below.
  432.  
  433. If you subscribe to either the CompuServe Information Service,
  434. the GEnie Information Service, or the Byte Information Exchange,
  435. you can send me electronic mail at the appropriate e-mail
  436. address below.  I check in to the CIS and GEnie services at
  437. least once a week -- usually more frequently -- and BIX at least
  438. twice a month.  Your e-mail will be acknowledged as soon as I
  439. receive it.
  440.  
  441. If you do not subscribe to either CompuServe, GEnie, or BIX you
  442. should contact me through USPS mail at the address below:
  443.  
  444. MAILING ADDRESS:
  445.      Michael E. Devore
  446.      Devore Software & Consulting
  447.      403 West Charles
  448.      Champaign, IL  61820
  449.  
  450. E-MAIL ADDRESSES:
  451.      CompuServe      71540,62
  452.      GEnie           MDEVORE
  453.      BIX             mdevore
  454.  
  455.  
  456. ------------------------------------------------------------------------------
  457. ------------------------------------------------------------------------------
  458.  
  459.  
  460. COMMENTS AND SUGGESTIONS
  461. ------------------------
  462.  
  463. If you have an idea for an improvement to LOVR, a comment or
  464. question about LOVR, or even a complaint about LOVR, please send
  465. it to either my USPS mailing address or one of the e-mail
  466. addresses below.  I am receptive to new ideas and constructive
  467. criticism.  Don't be shy, feedback oftens leads to improvements
  468. benefiting everyone.
  469.  
  470. LOVR began life as an offshoot of OVL, a non-linkable shell-type
  471. overlay manager I wrote that has several bells and whistles,
  472. including user-defineable, multiple overlay areas and
  473. multi-language capability.  LOVR has fewer options, but it can
  474. be linked in with QuickBASIC programs, resulting in one clean
  475. .EXE file.  Several people indicated a willingness to take the
  476. options versus one .EXE file trade-off, and thus LOVR was born.
  477.  
  478. If you wish a copy of OVL and you have been unsuccessful in
  479. obtaining a copy, you may send $6.00 to cover shipping and
  480. handling for the latest version to the USPS address below.
  481.  
  482.      Michael E. Devore
  483.      Devore Software & Consulting
  484.      403 West Charles
  485.      Champaign, IL  61820
  486.  
  487.      CompuServe      71540,62
  488.      GEnie           MDEVORE
  489.      BIX             mdevore
  490.  
  491.  
  492.          ----------------end-of-author's-documentation---------------
  493.  
  494.                         Software Library Information:
  495.  
  496.                    This disk copy provided as a service of
  497.  
  498.                         The Public (Software) Library
  499.  
  500.          We are not the authors of this program, nor are we associated
  501.          with the author in any way other than as a distributor of the
  502.          program in accordance with the author's terms of distribution.
  503.  
  504.          Please direct shareware payments and specific questions about
  505.          this program to the author of the program, whose name appears
  506.          elsewhere in  this documentation. If you have trouble getting
  507.          in touch with the author,  we will do whatever we can to help
  508.          you with your questions. All programs have been tested and do
  509.          run.  To report problems,  please use the form that is in the
  510.          file PROBLEM.DOC on many of our disks or in other written for-
  511.          mat with screen printouts, if possible.  The P(s)L cannot de-
  512.          bug programs over the telephone.
  513.  
  514.          Disks in the P(s)L are updated monthly, so if you did not get
  515.          this disk  directly from the P(s)L,  you should be aware that
  516.          the files in this set may no  longer be the current versions.
  517.  
  518.          For a copy of the latest monthly software library newsletter
  519.          and a list of the 1,400+ disks in the library, call or write
  520.  
  521.                         The Public (Software) Library
  522.                               P.O.Box 35705 - F
  523.                            Houston, TX 77235-5705
  524.                                (713) 665-7017
  525.  
  526.